//
//  AlertManager.h
//  Transfar_Business
//
//  Created by RiceJia on 15/11/11.
//  Copyright © 2015年 Transfar. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

typedef NS_ENUM(NSInteger,CHYBAlertMsgAlign) {
    CHYBAlertMsgAlignDefault = -1,
    CHYBAlertMsgAlignLeft = NSTextAlignmentLeft,
    CHYBAlertMsgAlignRight = NSTextAlignmentRight,
    CHYBAlertMsgAlignCenter = NSTextAlignmentCenter
    
};
typedef void (^SureBlock)();
typedef void (^NegateBlock)();

@interface AlertManager : NSObject<UIAlertViewDelegate>

/**
 *  弹出alert
 *
 *  @param title          标题
 *  @param message        信息
 *  @param msgAlign       信息对齐方式
 *  @param sureTitle      确定按钮文字
 *  @param negateTitle    取消按钮文字
 *  @param viewController 基础控制器
 *  @param sureBlock      确定后回调
 *  @param negateBlock    取消后回调
 */
- (void)showWithTitle:(NSString *)title message:(NSString *)message msgAlign:(CHYBAlertMsgAlign)msgAlign sure:(NSString *)sureTitle negate:(NSString *)negateTitle on:(UIViewController *)viewController sureBlock:(SureBlock)sureBlock negateBlock:(NegateBlock)negateBlock;

/**
 *  消息使用默认对齐方式 使用该方法
 */
- (void)showWithTitle:(NSString *)title message:(NSString *)message sure:(NSString *)sureTitle negate:(NSString *)negateTitle on:(UIViewController *)viewController sureBlock:(SureBlock)sureBlock negateBlock:(NegateBlock)negateBlock;
/**
 *  只有确定按钮 调用该方法 默认对齐方式
 *
 */
- (void)showWithTitle:(NSString *)title message:(NSString *)message sure:(NSString *)sureText on:(UIViewController *)viewController sureBlock:(SureBlock)sureBlock;

- (void)showWithTitle:(NSString *)title message:(NSString *)message msgAlign:(CHYBAlertMsgAlign)msgAlign sure:(NSString *)sureText on:(UIViewController *)viewController sureBlock:(SureBlock)sureBlock;
@end

/*iOS8以下，使用扩展UIAlaertView属性*/
@interface UIAlertView (block)<UIAlertViewDelegate>
@property (strong, nonatomic) void (^sureBlock)();
@property (strong, nonatomic) void (^negateBlock)();
@end
